{% extends 'home/base.html' %}
{% load static %}
{% block head_title %}归档{% endblock %}
{% block css %}
    <link rel="stylesheet" href="{% static 'css/blog/archive.css' %}">
{% endblock %}
{% block content %}
    <div class="archive-wrapper">
       <div>
            <main id="archives">
            {% regroup articles by create_at.year as  year_list %}
            {% for year_article in year_list %}
                <section class="time-section">
                    <h1 class="section-year">{{ year_article.grouper }}年</h1>
                    <div class="section-list">
                        {% regroup year_article.list by create_at.month as month_list %}
                        {% for month_article in month_list %}
                            {% for item in  month_article.list %}
                                <div class="section-list-item">
                                    <a href="{{ item.get_absolute_url }}" class="archive-title">{{ item.title }}</a>
                                    <p class="archive-date">{{ item.create_at|date:"m-d" }}</p>
                                </div>
                            {% endfor %}
                        {% endfor %}
                    </div>
                </section>
            {% endfor %}
        </main>
       </div>
    </div>
{% endblock %}